package com.atguigu.filter.filter;

import jakarta.servlet.FilterChain;
import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebFilter;
import jakarta.servlet.http.HttpFilter;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import java.io.IOException;

@WebFilter(urlPatterns = "/private/*")
public class Filter04Annotation extends HttpFilter {

    @Override
    protected void doFilter(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws IOException, ServletException {
        System.out.println("-----------------------Filter04Annotation 开始执行-----------------------");
        chain.doFilter(request, response);
        System.out.println("-----------------------Filter04Annotation 结束执行-----------------------");
    }
}
